Optimal. Leaf size=147 \[ \frac {2 i d^2 \text {Li}_2\left (-i e^{i (a+b x)}\right )}{b^3}-\frac {2 i d^2 \text {Li}_2\left (i e^{i (a+b x)}\right )}{b^3}+\frac {8 d^2 \cos (a+b x)}{b^3}+\frac {8 d (c+d x) \sin (a+b x)}{b^2}-\frac {4 i d (c+d x) \tan ^{-1}\left (e^{i (a+b x)}\right )}{b^2}-\frac {4 (c+d x)^2 \cos (a+b x)}{b}-\frac {(c+d x)^2 \sec (a+b x)}{b} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.21, antiderivative size = 147, normalized size of antiderivative = 1.00, number of steps used = 15, number of rules used = 8, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.320, Rules used = {4431, 3296, 2638, 4407, 4409, 4181, 2279, 2391} \[ \frac {2 i d^2 \text {PolyLog}\left (2,-i e^{i (a+b x)}\right )}{b^3}-\frac {2 i d^2 \text {PolyLog}\left (2,i e^{i (a+b x)}\right )}{b^3}+\frac {8 d (c+d x) \sin (a+b x)}{b^2}-\frac {4 i d (c+d x) \tan ^{-1}\left (e^{i (a+b x)}\right )}{b^2}+\frac {8 d^2 \cos (a+b x)}{b^3}-\frac {4 (c+d x)^2 \cos (a+b x)}{b}-\frac {(c+d x)^2 \sec (a+b x)}{b} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2279
Rule 2391
Rule 2638
Rule 3296
Rule 4181
Rule 4407
Rule 4409
Rule 4431
Rubi steps
\begin {align*} \int (c+d x)^2 \sec ^2(a+b x) \sin (3 a+3 b x) \, dx &=\int \left (3 (c+d x)^2 \sin (a+b x)-(c+d x)^2 \sin (a+b x) \tan ^2(a+b x)\right ) \, dx\\ &=3 \int (c+d x)^2 \sin (a+b x) \, dx-\int (c+d x)^2 \sin (a+b x) \tan ^2(a+b x) \, dx\\ &=-\frac {3 (c+d x)^2 \cos (a+b x)}{b}+\frac {(6 d) \int (c+d x) \cos (a+b x) \, dx}{b}+\int (c+d x)^2 \sin (a+b x) \, dx-\int (c+d x)^2 \sec (a+b x) \tan (a+b x) \, dx\\ &=-\frac {4 (c+d x)^2 \cos (a+b x)}{b}-\frac {(c+d x)^2 \sec (a+b x)}{b}+\frac {6 d (c+d x) \sin (a+b x)}{b^2}+\frac {(2 d) \int (c+d x) \cos (a+b x) \, dx}{b}+\frac {(2 d) \int (c+d x) \sec (a+b x) \, dx}{b}-\frac {\left (6 d^2\right ) \int \sin (a+b x) \, dx}{b^2}\\ &=-\frac {4 i d (c+d x) \tan ^{-1}\left (e^{i (a+b x)}\right )}{b^2}+\frac {6 d^2 \cos (a+b x)}{b^3}-\frac {4 (c+d x)^2 \cos (a+b x)}{b}-\frac {(c+d x)^2 \sec (a+b x)}{b}+\frac {8 d (c+d x) \sin (a+b x)}{b^2}-\frac {\left (2 d^2\right ) \int \log \left (1-i e^{i (a+b x)}\right ) \, dx}{b^2}+\frac {\left (2 d^2\right ) \int \log \left (1+i e^{i (a+b x)}\right ) \, dx}{b^2}-\frac {\left (2 d^2\right ) \int \sin (a+b x) \, dx}{b^2}\\ &=-\frac {4 i d (c+d x) \tan ^{-1}\left (e^{i (a+b x)}\right )}{b^2}+\frac {8 d^2 \cos (a+b x)}{b^3}-\frac {4 (c+d x)^2 \cos (a+b x)}{b}-\frac {(c+d x)^2 \sec (a+b x)}{b}+\frac {8 d (c+d x) \sin (a+b x)}{b^2}+\frac {\left (2 i d^2\right ) \operatorname {Subst}\left (\int \frac {\log (1-i x)}{x} \, dx,x,e^{i (a+b x)}\right )}{b^3}-\frac {\left (2 i d^2\right ) \operatorname {Subst}\left (\int \frac {\log (1+i x)}{x} \, dx,x,e^{i (a+b x)}\right )}{b^3}\\ &=-\frac {4 i d (c+d x) \tan ^{-1}\left (e^{i (a+b x)}\right )}{b^2}+\frac {8 d^2 \cos (a+b x)}{b^3}-\frac {4 (c+d x)^2 \cos (a+b x)}{b}+\frac {2 i d^2 \text {Li}_2\left (-i e^{i (a+b x)}\right )}{b^3}-\frac {2 i d^2 \text {Li}_2\left (i e^{i (a+b x)}\right )}{b^3}-\frac {(c+d x)^2 \sec (a+b x)}{b}+\frac {8 d (c+d x) \sin (a+b x)}{b^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] time = 3.83, size = 364, normalized size = 2.48 \[ \frac {-4 \cos (b x) \left (\cos (a) \left (b^2 (c+d x)^2-2 d^2\right )-2 b d \sin (a) (c+d x)\right )+4 \sin (b x) \left (\sin (a) \left (b^2 (c+d x)^2-2 d^2\right )+2 b d \cos (a) (c+d x)\right )-b^2 \sec (a) (c+d x)^2-\frac {b^2 \sin \left (\frac {b x}{2}\right ) (c+d x)^2}{\left (\cos \left (\frac {a}{2}\right )-\sin \left (\frac {a}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (a+b x)\right )-\sin \left (\frac {1}{2} (a+b x)\right )\right )}+\frac {b^2 \sin \left (\frac {b x}{2}\right ) (c+d x)^2}{\left (\sin \left (\frac {a}{2}\right )+\cos \left (\frac {a}{2}\right )\right ) \left (\sin \left (\frac {1}{2} (a+b x)\right )+\cos \left (\frac {1}{2} (a+b x)\right )\right )}+4 b c d \tanh ^{-1}\left (\cos (a) \tan \left (\frac {b x}{2}\right )+\sin (a)\right )+2 d^2 \left (2 \tan ^{-1}(\cot (a)) \tanh ^{-1}\left (\cos (a) \tan \left (\frac {b x}{2}\right )+\sin (a)\right )-\frac {\csc (a) \left (i \text {Li}_2\left (-e^{i \left (b x-\tan ^{-1}(\cot (a))\right )}\right )-i \text {Li}_2\left (e^{i \left (b x-\tan ^{-1}(\cot (a))\right )}\right )+\left (b x-\tan ^{-1}(\cot (a))\right ) \left (\log \left (1-e^{i \left (b x-\tan ^{-1}(\cot (a))\right )}\right )-\log \left (1+e^{i \left (b x-\tan ^{-1}(\cot (a))\right )}\right )\right )\right )}{\sqrt {\csc ^2(a)}}\right )}{b^3} \]
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.54, size = 513, normalized size = 3.49 \[ -\frac {b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + b^{2} c^{2} + i \, d^{2} \cos \left (b x + a\right ) {\rm Li}_2\left (i \, \cos \left (b x + a\right ) + \sin \left (b x + a\right )\right ) + i \, d^{2} \cos \left (b x + a\right ) {\rm Li}_2\left (i \, \cos \left (b x + a\right ) - \sin \left (b x + a\right )\right ) - i \, d^{2} \cos \left (b x + a\right ) {\rm Li}_2\left (-i \, \cos \left (b x + a\right ) + \sin \left (b x + a\right )\right ) - i \, d^{2} \cos \left (b x + a\right ) {\rm Li}_2\left (-i \, \cos \left (b x + a\right ) - \sin \left (b x + a\right )\right ) + 4 \, {\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + b^{2} c^{2} - 2 \, d^{2}\right )} \cos \left (b x + a\right )^{2} - {\left (b c d - a d^{2}\right )} \cos \left (b x + a\right ) \log \left (\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right ) + i\right ) + {\left (b c d - a d^{2}\right )} \cos \left (b x + a\right ) \log \left (\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right ) + i\right ) - {\left (b d^{2} x + a d^{2}\right )} \cos \left (b x + a\right ) \log \left (i \, \cos \left (b x + a\right ) + \sin \left (b x + a\right ) + 1\right ) + {\left (b d^{2} x + a d^{2}\right )} \cos \left (b x + a\right ) \log \left (i \, \cos \left (b x + a\right ) - \sin \left (b x + a\right ) + 1\right ) - {\left (b d^{2} x + a d^{2}\right )} \cos \left (b x + a\right ) \log \left (-i \, \cos \left (b x + a\right ) + \sin \left (b x + a\right ) + 1\right ) + {\left (b d^{2} x + a d^{2}\right )} \cos \left (b x + a\right ) \log \left (-i \, \cos \left (b x + a\right ) - \sin \left (b x + a\right ) + 1\right ) - {\left (b c d - a d^{2}\right )} \cos \left (b x + a\right ) \log \left (-\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right ) + i\right ) + {\left (b c d - a d^{2}\right )} \cos \left (b x + a\right ) \log \left (-\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right ) + i\right ) - 8 \, {\left (b d^{2} x + b c d\right )} \cos \left (b x + a\right ) \sin \left (b x + a\right )}{b^{3} \cos \left (b x + a\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (d x + c\right )}^{2} \sec \left (b x + a\right )^{2} \sin \left (3 \, b x + 3 \, a\right )\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.07, size = 328, normalized size = 2.23 \[ -\frac {4 c^{2} \cos \left (b x +a \right )}{b}-\frac {c^{2}}{b \cos \left (b x +a \right )}-\frac {4 d^{2} \cos \left (b x +a \right ) x^{2}}{b}+\frac {8 d^{2} \sin \left (b x +a \right ) x}{b^{2}}+\frac {8 d^{2} \cos \left (b x +a \right )}{b^{3}}-\frac {d^{2} x^{2}}{b \cos \left (b x +a \right )}-\frac {2 d^{2} \ln \left (1+i {\mathrm e}^{i \left (b x +a \right )}\right ) x}{b^{2}}-\frac {2 d^{2} \ln \left (1+i {\mathrm e}^{i \left (b x +a \right )}\right ) a}{b^{3}}+\frac {2 d^{2} \ln \left (1-i {\mathrm e}^{i \left (b x +a \right )}\right ) x}{b^{2}}+\frac {2 d^{2} \ln \left (1-i {\mathrm e}^{i \left (b x +a \right )}\right ) a}{b^{3}}+\frac {2 i d^{2} \dilog \left (1+i {\mathrm e}^{i \left (b x +a \right )}\right )}{b^{3}}-\frac {2 i d^{2} \dilog \left (1-i {\mathrm e}^{i \left (b x +a \right )}\right )}{b^{3}}-\frac {2 a \,d^{2} \ln \left (\sec \left (b x +a \right )+\tan \left (b x +a \right )\right )}{b^{3}}-\frac {8 c d \cos \left (b x +a \right ) x}{b}+\frac {8 c d \sin \left (b x +a \right )}{b^{2}}-\frac {2 c d x}{b \cos \left (b x +a \right )}+\frac {2 c d \ln \left (\sec \left (b x +a \right )+\tan \left (b x +a \right )\right )}{b^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F(-1)] time = 0.00, size = -1, normalized size = -0.01 \[ \text {Hanged} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: HeuristicGCDFailed} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________